/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.awt.CardLayout;

/**
 *
 * @author Jennerson
 */
public class Principal extends javax.swing.JFrame {

    /**
     * Creates new form Principal
     */
    public Principal() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jPanelPrincipal = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu2 = new javax.swing.JMenu();
        jMenuItemCurso = new javax.swing.JMenuItem();
        jMenuItemProfessor = new javax.swing.JMenuItem();
        jMenuItemDisciplina = new javax.swing.JMenuItem();
        jMenuItemHorarioDasAulas = new javax.swing.JMenuItem();
        jMenuItemHorario = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItemRelatorioPeriodo = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema de Gerenciamento de Horário");
        setMinimumSize(new java.awt.Dimension(850, 600));
        setName("Principal"); // NOI18N
        setResizable(false);

        jLabel1.setBackground(new java.awt.Color(255, 255, 255));
        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Sistema de Gerenciamento de Horário");

        jPanelPrincipal.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanelPrincipal.setMaximumSize(new java.awt.Dimension(830, 512));
        jPanelPrincipal.setMinimumSize(new java.awt.Dimension(830, 512));
        jPanelPrincipal.setLayout(new java.awt.CardLayout());

        jMenu2.setText("Cadastrar");

        jMenuItemCurso.setText("Cadastrar Curso");
        jMenuItemCurso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemCursoActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItemCurso);

        jMenuItemProfessor.setText("Cadastrar Professor");
        jMenuItemProfessor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemProfessorActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItemProfessor);

        jMenuItemDisciplina.setText("Cadastrar Disciplina");
        jMenuItemDisciplina.setToolTipText("");
        jMenuItemDisciplina.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemDisciplinaActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItemDisciplina);

        jMenuItemHorarioDasAulas.setText("Cadastrar Horário das Aulas");
        jMenuItemHorarioDasAulas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemHorarioDasAulasActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItemHorarioDasAulas);

        jMenuItemHorario.setText("Cadastrar Horário");
        jMenuItemHorario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemHorarioActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItemHorario);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Relatório");

        jMenuItemRelatorioPeriodo.setText("Relatório por Turma");
        jMenuItemRelatorioPeriodo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemRelatorioPeriodoActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItemRelatorioPeriodo);

        jMenuItem1.setText("Relatório por Professor");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem1);

        jMenuItem2.setText("Relatório por Turno");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem2);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 850, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemCursoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCursoActionPerformed
        PainelCurso  painelCurso = new PainelCurso();
       jPanelPrincipal.add(painelCurso);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelCurso, "painelCurso");
       cardLayout.show(jPanelPrincipal, "painelCurso");
       painelCurso.setVisible(true);
    }//GEN-LAST:event_jMenuItemCursoActionPerformed

    private void jMenuItemProfessorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemProfessorActionPerformed
       PainelProfessor  painelProfessor = new PainelProfessor();
       jPanelPrincipal.add(painelProfessor);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelProfessor, "painelProfessor");
       cardLayout.show(jPanelPrincipal, "painelProfessor");
       painelProfessor.setVisible(true);
    }//GEN-LAST:event_jMenuItemProfessorActionPerformed

    private void jMenuItemDisciplinaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDisciplinaActionPerformed
       PainelDisciplina  painelDisciplina = new PainelDisciplina();
       jPanelPrincipal.add(painelDisciplina);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelDisciplina, "painelDisciplina");
       cardLayout.show(jPanelPrincipal, "painelDisciplina");
       painelDisciplina.setVisible(true);
    }//GEN-LAST:event_jMenuItemDisciplinaActionPerformed

    private void jMenuItemRelatorioPeriodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRelatorioPeriodoActionPerformed
       PainelHorarioTurma painelHorarioPeriodo = new PainelHorarioTurma();
       jPanelPrincipal.add(painelHorarioPeriodo);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelHorarioPeriodo, "painelHorarioPeriodo");
       cardLayout.show(jPanelPrincipal, "painelHorarioPeriodo");
       painelHorarioPeriodo.setVisible(true);
    }//GEN-LAST:event_jMenuItemRelatorioPeriodoActionPerformed

    private void jMenuItemHorarioDasAulasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHorarioDasAulasActionPerformed
       PainelHorario painelHorario = new PainelHorario();
       jPanelPrincipal.add(painelHorario);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelHorario, "painelHorario");
       cardLayout.show(jPanelPrincipal, "painelHorario");
       painelHorario.setVisible(true);
    }//GEN-LAST:event_jMenuItemHorarioDasAulasActionPerformed

    private void jMenuItemHorarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHorarioActionPerformed
       PainelCadastraHorario painelCadastraHorario = new PainelCadastraHorario();
       jPanelPrincipal.add(painelCadastraHorario);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelCadastraHorario, "painelCadastraHorario");
       cardLayout.show(jPanelPrincipal, "painelCadastraHorario");
       painelCadastraHorario.setVisible(true);
    }//GEN-LAST:event_jMenuItemHorarioActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
       PainelHorarioProfessor painelHorarioProfessor = new PainelHorarioProfessor();
       jPanelPrincipal.add(painelHorarioProfessor);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelHorarioProfessor, "painelHorarioProfessor");
       cardLayout.show(jPanelPrincipal, "painelHorarioProfessor");
       painelHorarioProfessor.setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
       PainelHorarioTurno painelHorarioTurno = new PainelHorarioTurno();
       jPanelPrincipal.add(painelHorarioTurno);
       CardLayout cardLayout = (CardLayout) jPanelPrincipal.getLayout();
       cardLayout.addLayoutComponent(painelHorarioTurno, "painelHorarioTurno");
       cardLayout.show(jPanelPrincipal, "painelHorarioTurno");
       painelHorarioTurno.setVisible(true);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Metal".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Principal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItemCurso;
    private javax.swing.JMenuItem jMenuItemDisciplina;
    private javax.swing.JMenuItem jMenuItemHorario;
    private javax.swing.JMenuItem jMenuItemHorarioDasAulas;
    private javax.swing.JMenuItem jMenuItemProfessor;
    private javax.swing.JMenuItem jMenuItemRelatorioPeriodo;
    private javax.swing.JPanel jPanelPrincipal;
    // End of variables declaration//GEN-END:variables
}
